package com.lch.netty.bio.tomcat.http;

import java.io.IOException;

/**
 * @author: liuchenhui
 * @create: 2019-10-14 11:45
 **/
public abstract class Servlet {

    public void service(Request request, Response response) throws IOException {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request, response);
        } else {
            doPost(request, response);
        }
    }

    protected abstract void doGet(Request request, Response response) throws IOException;

    protected abstract void doPost(Request request, Response response) throws IOException;
}
